// 前中后续
function before(tree) {
    if (tree) {
        console.log("前序")
        before(tree.left)
        before(tree.right)
    }
}

function middle(tree) {
    if (tree) {
        middle(tree.left)
        console.log("中顺序")
        middle(tree.right)
    }
}

function after(tree) {
    if (tree) {
        middle(tree.left)
        middle(tree.right)
        console.log("后顺序")
    }
}